/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-11     JAMO       the first version
 */
#ifndef APPLICATIONS_IFP_DEF_H_
#define APPLICATIONS_IFP_DEF_H_
#include <rtthread.h>
#include <rtdevice.h>
#include <stdbool.h>

#define LOG_FLOAT_MARKER "%s%d.%02d"

/**
 * @brief Macro for dissecting a float number into two numbers (integer and residuum).
 */
#define LOG_FLOAT_VOL(val) (uint32_t)(((val) < 0 && (val) > -1.0) ? "-" : ""),   \
                           (int32_t)(val),                                       \
                           (int32_t)((((val) > 0) ? (val) - (int32_t)(val)       \
                                                : (int32_t)(val) - (val))*100)

#endif /* APPLICATIONS_IFP_DEF_H_ */
